.class Les/z9$c;
.super Ljava/lang/Object;
.source "AudioVolumePlayer.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Les/z9;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "c"
.end annotation


# instance fields
.field private a:Landroid/media/AudioTrack;

.field private b:I

.field private c:I

.field private final d:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/esfile/screen/recorder/media/util/l;",
            ">;"
        }
    .end annotation
.end field

.field private e:Z

.field private f:I

.field private g:I

.field private h:I

.field private i:Ljava/nio/ByteBuffer;

.field private j:Les/ca;

.field private k:Ljava/nio/ByteBuffer;

.field private l:Ljava/nio/ByteBuffer;

.field private m:Ljava/nio/ByteBuffer;

.field final synthetic n:Les/z9;


# direct methods
.method private constructor <init>(Les/z9;)V
    .locals 1

    .line 1
    iput-object p1, p0, Les/z9$c;->n:Les/z9;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 p1, 0x0

    .line 2
    iput-object p1, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    .line 3
    new-instance p1, Ljava/util/ArrayList;

    const/4 v0, 0x6

    invoke-direct {p1, v0}, Ljava/util/ArrayList;-><init>(I)V

    iput-object p1, p0, Les/z9$c;->d:Ljava/util/List;

    const/4 p1, 0x0

    .line 4
    iput-boolean p1, p0, Les/z9$c;->e:Z

    const/4 p1, -0x1

    .line 5
    iput p1, p0, Les/z9$c;->h:I

    return-void
.end method

.method synthetic constructor <init>(Les/z9;Les/z9$a;)V
    .locals 0

    .line 6
    invoke-direct {p0, p1}, Les/z9$c;-><init>(Les/z9;)V

    return-void
.end method

.method private a(I)I
    .locals 3

    packed-switch p1, :pswitch_data_0

    .line 1
    new-instance v0, Ljava/lang/IllegalArgumentException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Unsupported channel count: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 2
    :pswitch_0
    sget p1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v0, 0x17

    if-ge p1, v0, :cond_0

    const/16 p1, 0x3fc

    goto :goto_0

    :cond_0
    const/16 p1, 0x18fc

    goto :goto_0

    :pswitch_1
    const/16 p1, 0x4fc

    goto :goto_0

    :pswitch_2
    const/16 p1, 0xfc

    goto :goto_0

    :pswitch_3
    const/16 p1, 0xdc

    goto :goto_0

    :pswitch_4
    const/16 p1, 0xcc

    goto :goto_0

    :pswitch_5
    const/16 p1, 0x1c

    goto :goto_0

    :pswitch_6
    const/16 p1, 0xc

    goto :goto_0

    :pswitch_7
    const/4 p1, 0x4

    :goto_0
    return p1

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_7
        :pswitch_6
        :pswitch_5
        :pswitch_4
        :pswitch_3
        :pswitch_2
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method private a(Ljava/nio/ByteBuffer;Z)I
    .locals 7

    .line 37
    invoke-direct {p0}, Les/z9$c;->e()I

    move-result v0

    .line 38
    iget-object v1, p0, Les/z9$c;->j:Les/ca;

    const/4 v2, 0x0

    if-nez v1, :cond_4

    .line 39
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result p2

    if-lez p2, :cond_3

    .line 40
    iget-object p2, p0, Les/z9$c;->m:Ljava/nio/ByteBuffer;

    if-eqz p2, :cond_0

    invoke-virtual {p2}, Ljava/nio/ByteBuffer;->capacity()I

    move-result p2

    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->capacity()I

    move-result v0

    if-ge p2, v0, :cond_1

    .line 41
    :cond_0
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->capacity()I

    move-result p2

    invoke-static {p2}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object p2

    iput-object p2, p0, Les/z9$c;->m:Ljava/nio/ByteBuffer;

    .line 42
    :cond_1
    iget-object p2, p0, Les/z9$c;->m:Ljava/nio/ByteBuffer;

    iput-object p2, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    .line 43
    invoke-virtual {p2}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 44
    iget-object p2, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    invoke-static {p1, p2}, Les/x9;->a(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)Z

    move-result p1

    if-nez p1, :cond_2

    .line 45
    iget-object p1, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->flip()Ljava/nio/Buffer;

    .line 46
    :cond_2
    iget-object p1, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result p1

    return p1

    :cond_3
    return v2

    .line 47
    :cond_4
    iget v1, p0, Les/z9$c;->h:I

    if-ne v0, v1, :cond_6

    iget-object v1, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    .line 48
    invoke-static {p1, v1}, Les/x9;->a(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)Z

    move-result v1

    if-nez v1, :cond_6

    if-eqz p2, :cond_5

    goto :goto_0

    :cond_5
    return v2

    .line 49
    :cond_6
    :goto_0
    iget v1, p0, Les/z9$c;->h:I

    if-ne v0, v1, :cond_7

    if-eqz p2, :cond_8

    .line 50
    :cond_7
    iget-object v1, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->position()I

    move-result v1

    if-lez v1, :cond_b

    .line 51
    iget-object v1, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->flip()Ljava/nio/Buffer;

    .line 52
    :cond_8
    iget-object v1, p0, Les/z9$c;->j:Les/ca;

    iget-object v3, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    iget-object v4, p0, Les/z9$c;->k:Ljava/nio/ByteBuffer;

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v5

    iget v6, p0, Les/z9$c;->h:I

    if-ne v0, v6, :cond_9

    if-eqz p2, :cond_a

    .line 53
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result p1

    if-gtz p1, :cond_a

    :cond_9
    const/4 v2, 0x1

    .line 54
    :cond_a
    invoke-virtual {v1, v3, v4, v5, v2}, Les/ca;->a(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;IZ)I

    .line 55
    iget-object p1, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 56
    iget-object p1, p0, Les/z9$c;->k:Ljava/nio/ByteBuffer;

    iput-object p1, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    .line 57
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result p1

    return p1

    :cond_b
    return v2
.end method

.method private a(Ljava/nio/ByteBuffer;II)V
    .locals 8

    .line 58
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0}, Les/z9;->c(Les/z9;)F

    move-result v0

    const/high16 v1, 0x3f800000    # 1.0f

    cmpl-float v0, v0, v1

    if-eqz v0, :cond_3

    .line 59
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0}, Les/z9;->c(Les/z9;)F

    move-result v0

    invoke-static {}, Landroid/media/AudioTrack;->getMaxVolume()F

    move-result v2

    cmpg-float v0, v0, v2

    if-gtz v0, :cond_0

    .line 60
    iget-object p2, p0, Les/z9$c;->n:Les/z9;

    invoke-static {p2}, Les/z9;->a(Les/z9;)Les/z9$c;

    move-result-object p2

    iget-object p3, p0, Les/z9$c;->n:Les/z9;

    invoke-static {p3}, Les/z9;->c(Les/z9;)F

    move-result p3

    invoke-virtual {p2, p3}, Les/z9$c;->a(F)V

    goto :goto_0

    .line 61
    :cond_0
    iget-object v0, p0, Les/z9$c;->m:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->capacity()I

    move-result v0

    if-ge v0, p3, :cond_2

    .line 62
    :cond_1
    invoke-static {p3}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v0

    iput-object v0, p0, Les/z9$c;->m:Ljava/nio/ByteBuffer;

    .line 63
    :cond_2
    iget-object v0, p0, Les/z9$c;->m:Ljava/nio/ByteBuffer;

    iput-object v0, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    .line 64
    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 65
    iget-object v3, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0}, Les/z9;->c(Les/z9;)F

    move-result v4

    const/16 v7, 0x10

    move-object v2, p1

    move v5, p2

    move v6, p3

    invoke-static/range {v2 .. v7}, Les/x9;->a(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;FIII)V

    .line 66
    iget-object p1, p0, Les/z9$c;->n:Les/z9;

    invoke-static {p1}, Les/z9;->a(Les/z9;)Les/z9$c;

    move-result-object p1

    invoke-virtual {p1, v1}, Les/z9$c;->a(F)V

    return-void

    .line 67
    :cond_3
    iget-object p2, p0, Les/z9$c;->n:Les/z9;

    invoke-static {p2}, Les/z9;->a(Les/z9;)Les/z9$c;

    move-result-object p2

    invoke-virtual {p2, v1}, Les/z9$c;->a(F)V

    .line 68
    :goto_0
    iput-object p1, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    return-void
.end method

.method private b(II)I
    .locals 6

    .line 1
    invoke-direct {p0, p2}, Les/z9$c;->a(I)I

    move-result v0

    const/4 v1, 0x2

    .line 2
    invoke-static {p1, v0, v1}, Landroid/media/AudioTrack;->getMinBufferSize(III)I

    move-result v0

    mul-int/lit8 v1, v0, 0x4

    int-to-long v2, p1

    const-wide/32 v4, 0xb71b0

    mul-long v2, v2, v4

    int-to-long p1, p2

    mul-long v2, v2, p1

    const-wide/16 p1, 0x2

    mul-long v2, v2, p1

    const-wide/32 p1, 0xf4240

    .line 3
    div-long/2addr v2, p1

    long-to-int p1, v2

    if-le p1, v0, :cond_0

    if-le v1, p1, :cond_0

    move v1, p1

    .line 4
    :cond_0
    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "minBuffer:"

    invoke-virtual {p2, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v0, " maxBufferSize:"

    invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string p1, " bufferSize:"

    invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string p2, "avp"

    invoke-static {p2, p1}, Lcom/esfile/screen/recorder/media/util/k;->c(Ljava/lang/String;Ljava/lang/String;)V

    return v1
.end method

.method private b(Lcom/esfile/screen/recorder/media/util/l;)I
    .locals 8

    .line 8
    iget-object v0, p1, Lcom/esfile/screen/recorder/media/util/l;->f:Landroid/media/MediaCodec$BufferInfo;

    iget v0, v0, Landroid/media/MediaCodec$BufferInfo;->flags:I

    and-int/lit8 v0, v0, 0x4

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    .line 9
    :goto_0
    iget v3, p0, Les/z9$c;->f:I

    if-nez v3, :cond_1

    .line 10
    iget-object v3, p1, Lcom/esfile/screen/recorder/media/util/l;->f:Landroid/media/MediaCodec$BufferInfo;

    iget v3, v3, Landroid/media/MediaCodec$BufferInfo;->size:I

    iput v3, p0, Les/z9$c;->f:I

    .line 11
    :cond_1
    iget v3, p0, Les/z9$c;->g:I

    if-nez v3, :cond_2

    .line 12
    iget-object v3, p1, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    invoke-direct {p0, v3, v0}, Les/z9$c;->a(Ljava/nio/ByteBuffer;Z)I

    move-result v3

    iput v3, p0, Les/z9$c;->g:I

    .line 13
    iget-object v3, p1, Lcom/esfile/screen/recorder/media/util/l;->b:Ljava/nio/ByteBuffer;

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v3

    iput v3, p0, Les/z9$c;->f:I

    .line 14
    iget v3, p0, Les/z9$c;->g:I

    if-lez v3, :cond_2

    .line 15
    iget-object v4, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    invoke-direct {p0, v4, v1, v3}, Les/z9$c;->a(Ljava/nio/ByteBuffer;II)V

    .line 16
    iget-object v3, p0, Les/z9$c;->n:Les/z9;

    iget-wide v4, p1, Lcom/esfile/screen/recorder/media/util/l;->c:J

    const-wide/16 v6, 0x3e8

    div-long/2addr v4, v6

    long-to-int p1, v4

    invoke-static {v3, p1}, Les/z9;->c(Les/z9;I)I

    .line 17
    :cond_2
    iget p1, p0, Les/z9$c;->g:I

    if-lez p1, :cond_4

    .line 18
    iget-object v3, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    iget-object v4, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    invoke-virtual {v3, v4, p1, v2}, Landroid/media/AudioTrack;->write(Ljava/nio/ByteBuffer;II)I

    move-result p1

    if-gez p1, :cond_3

    const/4 p1, 0x2

    return p1

    .line 19
    :cond_3
    iget v3, p0, Les/z9$c;->g:I

    sub-int/2addr v3, p1

    iput v3, p0, Les/z9$c;->g:I

    .line 20
    :cond_4
    iget p1, p0, Les/z9$c;->g:I

    if-nez p1, :cond_6

    if-eqz v0, :cond_5

    const/4 p1, 0x3

    return p1

    .line 21
    :cond_5
    iget-object p1, p0, Les/z9$c;->n:Les/z9;

    invoke-static {p1}, Les/z9;->g(Les/z9;)Les/z9$f;

    move-result-object p1

    iget-wide v3, p1, Les/z9$f;->b:J

    const-wide/16 v5, 0x0

    cmp-long p1, v3, v5

    if-lez p1, :cond_6

    iget-object p1, p0, Les/z9$c;->n:Les/z9;

    invoke-static {p1}, Les/z9;->f(Les/z9;)I

    move-result p1

    int-to-long v3, p1

    iget-object p1, p0, Les/z9$c;->n:Les/z9;

    invoke-static {p1}, Les/z9;->g(Les/z9;)Les/z9$f;

    move-result-object p1

    iget-wide v5, p1, Les/z9$f;->b:J

    cmp-long p1, v3, v5

    if-lez p1, :cond_6

    return v2

    .line 22
    :cond_6
    iget p1, p0, Les/z9$c;->f:I

    if-nez p1, :cond_7

    if-nez v0, :cond_7

    return v2

    :cond_7
    return v1
.end method

.method private e()I
    .locals 5

    .line 1
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x17

    if-lt v0, v1, :cond_0

    .line 2
    iget-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {v0}, Landroid/media/AudioTrack;->getPlaybackParams()Landroid/media/PlaybackParams;

    move-result-object v0

    .line 3
    iget-object v1, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v1}, Les/z9;->h(Les/z9;)F

    move-result v1

    invoke-virtual {v0, v1}, Landroid/media/PlaybackParams;->setSpeed(F)Landroid/media/PlaybackParams;

    .line 4
    iget-object v1, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v1}, Les/z9;->h(Les/z9;)F

    move-result v1

    invoke-virtual {v0, v1}, Landroid/media/PlaybackParams;->setPitch(F)Landroid/media/PlaybackParams;

    .line 5
    iget-object v1, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {v1, v0}, Landroid/media/AudioTrack;->setPlaybackParams(Landroid/media/PlaybackParams;)V

    .line 6
    iget v0, p0, Les/z9$c;->b:I

    return v0

    .line 7
    :cond_0
    iget v0, p0, Les/z9$c;->b:I

    int-to-float v0, v0

    iget-object v1, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v1}, Les/z9;->h(Les/z9;)F

    move-result v1

    div-float/2addr v0, v1

    float-to-int v0, v0

    .line 8
    iget v1, p0, Les/z9$c;->h:I

    if-eq v1, v0, :cond_7

    iget-object v1, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    if-eqz v1, :cond_1

    .line 9
    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->position()I

    move-result v1

    if-nez v1, :cond_7

    .line 10
    :cond_1
    iget v1, p0, Les/z9$c;->b:I

    if-eq v1, v0, :cond_6

    .line 11
    iget v2, p0, Les/z9$c;->c:I

    mul-int/lit16 v3, v2, 0x2000

    .line 12
    new-instance v4, Les/ca;

    invoke-direct {v4, v1, v0, v2, v3}, Les/ca;-><init>(IIII)V

    iput-object v4, p0, Les/z9$c;->j:Les/ca;

    .line 13
    iget-object v1, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    if-eqz v1, :cond_2

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->capacity()I

    move-result v1

    if-ge v1, v3, :cond_3

    .line 14
    :cond_2
    invoke-static {v3}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v1

    iput-object v1, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    .line 15
    :cond_3
    iget-object v1, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 16
    iget-object v1, p0, Les/z9$c;->j:Les/ca;

    invoke-virtual {v1, v3}, Les/ca;->a(I)I

    move-result v1

    .line 17
    iget-object v2, p0, Les/z9$c;->k:Ljava/nio/ByteBuffer;

    if-eqz v2, :cond_4

    invoke-virtual {v2}, Ljava/nio/ByteBuffer;->capacity()I

    move-result v2

    if-ge v2, v1, :cond_5

    .line 18
    :cond_4
    invoke-static {v1}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v1

    iput-object v1, p0, Les/z9$c;->k:Ljava/nio/ByteBuffer;

    .line 19
    :cond_5
    iget-object v1, p0, Les/z9$c;->k:Ljava/nio/ByteBuffer;

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    goto :goto_0

    :cond_6
    const/4 v1, 0x0

    .line 20
    iput-object v1, p0, Les/z9$c;->j:Les/ca;

    .line 21
    :goto_0
    iput v0, p0, Les/z9$c;->h:I

    :cond_7
    return v0
.end method


# virtual methods
.method public declared-synchronized a()V
    .locals 2

    monitor-enter p0

    .line 25
    :try_start_0
    iget-object v0, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/esfile/screen/recorder/media/util/l;

    .line 26
    invoke-virtual {v1}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    goto :goto_0

    .line 27
    :cond_0
    iget-object v0, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    .line 28
    iget-object v0, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_1

    .line 29
    iget-object v0, p0, Les/z9$c;->i:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 30
    :cond_1
    iget-object v0, p0, Les/z9$c;->k:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_2

    .line 31
    iget-object v0, p0, Les/z9$c;->k:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    .line 32
    :cond_2
    iget-object v0, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_3

    .line 33
    iget-object v0, p0, Les/z9$c;->l:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->clear()Ljava/nio/Buffer;

    :cond_3
    const/4 v0, 0x0

    .line 34
    iput v0, p0, Les/z9$c;->f:I

    .line 35
    iput v0, p0, Les/z9$c;->g:I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 36
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    goto :goto_2

    :goto_1
    throw v0

    :goto_2
    goto :goto_1
.end method

.method public declared-synchronized a(F)V
    .locals 1

    monitor-enter p0

    .line 22
    :try_start_0
    iget-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    if-eqz v0, :cond_0

    .line 23
    iget-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {v0, p1}, Landroid/media/AudioTrack;->setVolume(F)I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 24
    :cond_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public declared-synchronized a(Lcom/esfile/screen/recorder/media/util/l;)V
    .locals 1

    monitor-enter p0

    .line 17
    :try_start_0
    iget-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    if-eqz v0, :cond_0

    .line 18
    iget-object v0, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 19
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V

    goto :goto_0

    .line 20
    :cond_0
    invoke-virtual {p1}, Lcom/esfile/screen/recorder/media/util/l;->a()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 21
    :goto_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public declared-synchronized a(II)Z
    .locals 9

    monitor-enter p0

    .line 3
    :try_start_0
    iget-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    if-eqz v0, :cond_0

    .line 4
    iget-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {v0}, Landroid/media/AudioTrack;->release()V

    goto :goto_0

    .line 5
    :cond_0
    new-instance v0, Ljava/lang/Thread;

    const-string v1, "audio volume player"

    invoke-direct {v0, p0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 6
    :goto_0
    :try_start_1
    invoke-virtual {p0}, Les/z9$c;->a()V

    .line 7
    iput p1, p0, Les/z9$c;->b:I

    .line 8
    iput p2, p0, Les/z9$c;->c:I

    .line 9
    invoke-direct {p0, p2}, Les/z9$c;->a(I)I

    move-result v5

    .line 10
    invoke-direct {p0, p1, p2}, Les/z9$c;->b(II)I

    move-result v7

    .line 11
    new-instance p2, Landroid/media/AudioTrack;

    const/4 v3, 0x3

    const/4 v6, 0x2

    const/4 v8, 0x1

    move-object v2, p2

    move v4, p1

    invoke-direct/range {v2 .. v8}, Landroid/media/AudioTrack;-><init>(IIIIII)V

    iput-object p2, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    .line 12
    invoke-virtual {p2}, Landroid/media/AudioTrack;->play()V

    .line 13
    invoke-virtual {p0}, Les/z9$c;->d()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    const/4 p1, 0x1

    .line 14
    monitor-exit p0

    return p1

    :catch_0
    move-exception p1

    .line 15
    :try_start_2
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    const/4 p1, 0x0

    .line 16
    monitor-exit p0

    return p1

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public declared-synchronized b()V
    .locals 1

    monitor-enter p0

    const/4 v0, 0x1

    .line 5
    :try_start_0
    iput-boolean v0, p0, Les/z9$c;->e:Z

    .line 6
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 7
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized c()V
    .locals 2

    monitor-enter p0

    .line 1
    :try_start_0
    iget-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    if-eqz v0, :cond_0

    .line 2
    iget-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    invoke-virtual {v0}, Landroid/media/AudioTrack;->release()V

    const/4 v0, 0x0

    .line 3
    iput-object v0, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    .line 4
    :cond_0
    iget-object v0, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/esfile/screen/recorder/media/util/l;

    .line 5
    invoke-virtual {v1}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    goto :goto_0

    .line 6
    :cond_1
    iget-object v0, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    .line 7
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 8
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    goto :goto_2

    :goto_1
    throw v0

    :goto_2
    goto :goto_1
.end method

.method public declared-synchronized d()V
    .locals 1

    monitor-enter p0

    const/4 v0, 0x0

    .line 1
    :try_start_0
    iput-boolean v0, p0, Les/z9$c;->e:Z

    .line 2
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 3
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public run()V
    .locals 6

    .line 1
    :cond_0
    :goto_0
    monitor-enter p0

    :goto_1
    const/4 v0, 0x1

    const/4 v1, 0x0

    .line 2
    :try_start_0
    iget-object v2, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    if-eqz v2, :cond_2

    iget-object v2, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->isEmpty()Z

    move-result v2

    if-nez v2, :cond_1

    iget-boolean v2, p0, Les/z9$c;->e:Z

    if-eqz v2, :cond_2

    .line 3
    :cond_1
    invoke-virtual {p0}, Ljava/lang/Object;->wait()V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_1
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_1

    .line 4
    :cond_2
    :try_start_1
    iget-object v2, p0, Les/z9$c;->a:Landroid/media/AudioTrack;

    if-eqz v2, :cond_7

    iget-object v2, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->isEmpty()Z

    move-result v2

    if-eqz v2, :cond_3

    goto :goto_3

    .line 5
    :cond_3
    iget-object v2, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v2, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/esfile/screen/recorder/media/util/l;

    const/4 v3, 0x2

    if-eqz v2, :cond_6

    .line 6
    invoke-direct {p0, v2}, Les/z9$c;->b(Lcom/esfile/screen/recorder/media/util/l;)I

    move-result v4

    if-ne v4, v0, :cond_4

    .line 7
    iget-object v0, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 8
    invoke-virtual {v2}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    goto :goto_2

    :cond_4
    const/4 v5, 0x3

    if-ne v4, v5, :cond_5

    .line 9
    iget-object v0, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 10
    invoke-virtual {v2}, Lcom/esfile/screen/recorder/media/util/l;->a()V

    .line 11
    iget-object v0, p0, Les/z9$c;->d:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_6

    .line 12
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0, v5}, Les/z9;->b(Les/z9;I)I

    .line 13
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0, v1}, Les/z9;->a(Les/z9;Z)Z

    .line 14
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0}, Les/z9;->e(Les/z9;)Les/z9$d;

    move-result-object v0

    if-eqz v0, :cond_6

    .line 15
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0}, Les/z9;->e(Les/z9;)Les/z9$d;

    move-result-object v0

    iget-object v1, p0, Les/z9$c;->n:Les/z9;

    invoke-interface {v0, v1}, Les/z9$d;->a(Les/z9;)V

    goto :goto_2

    :cond_5
    if-ne v4, v3, :cond_6

    .line 16
    monitor-exit p0

    goto :goto_5

    .line 17
    :cond_6
    :goto_2
    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 18
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0}, Les/z9;->d(Les/z9;)I

    move-result v0

    if-ne v0, v3, :cond_0

    const-wide/16 v0, 0xa

    .line 19
    :try_start_2
    invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V
    :try_end_2
    .catch Ljava/lang/InterruptedException; {:try_start_2 .. :try_end_2} :catch_0

    goto/16 :goto_0

    :catch_0
    move-exception v0

    .line 20
    invoke-virtual {v0}, Ljava/lang/InterruptedException;->printStackTrace()V

    goto/16 :goto_0

    .line 21
    :cond_7
    :goto_3
    :try_start_3
    monitor-exit p0

    goto :goto_4

    :catchall_0
    move-exception v0

    goto :goto_6

    .line 22
    :catch_1
    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V

    .line 23
    monitor-exit p0
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    :goto_4
    const/4 v0, 0x0

    :goto_5
    if-eqz v0, :cond_8

    .line 24
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0}, Les/z9;->b(Les/z9;)Les/z9$e;

    move-result-object v0

    if-eqz v0, :cond_8

    .line 25
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-virtual {v0}, Les/z9;->g()V

    .line 26
    iget-object v0, p0, Les/z9$c;->n:Les/z9;

    invoke-static {v0}, Les/z9;->b(Les/z9;)Les/z9$e;

    move-result-object v0

    iget-object v1, p0, Les/z9$c;->n:Les/z9;

    new-instance v2, Ljava/lang/RuntimeException;

    const-string v3, "AudioTrack write error"

    invoke-direct {v2, v3}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    invoke-interface {v0, v1, v2}, Les/z9$e;->a(Les/z9;Ljava/lang/Exception;)V

    :cond_8
    return-void

    .line 27
    :goto_6
    :try_start_4
    monitor-exit p0
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    goto :goto_8

    :goto_7
    throw v0

    :goto_8
    goto :goto_7
.end method
